package com.jmu.posms.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.jmu.posms.pojo.Newspaper;
import com.jmu.posms.pojo.User;
import com.jmu.posms.service.NewspaperService;
import com.jmu.posms.dao.NewspaperMapper;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
* @author 青暮月上
* @description 针对表【newspaper】的数据库操作Service实现
* @createDate 2022-06-24 21:17:17
*/
@Service
public class NewspaperServiceImpl extends ServiceImpl<NewspaperMapper, Newspaper> implements NewspaperService{
    @Resource
    NewspaperMapper newspaperMapper;

    @Override
    public List<Newspaper> findListByNewsName(String name){
        LambdaQueryWrapper<Newspaper> queryWrapper = new LambdaQueryWrapper<>();
        queryWrapper.like(Newspaper::getName, name);

        List<Newspaper> news = newspaperMapper.selectList(queryWrapper);
        return news;
    }
}
